<template>
  <!-- 必须有模板（哪怕是空标签） -->
  <div></div>
</template>

<script lang="ts" >
import '../style/app.css';
import { defineComponent } from 'vue';
import { StreamClientScrcpy } from '@/app/googDevice/client/StreamClientScrcpy';


export default defineComponent({
  name: "RoomPage",
  async setup() {
    const hash = location.hash.replace(/^#!/, '');
    const parsedQuery = new URLSearchParams(hash);
    console.log("jjdjdjjd")

/// #if USE_BROADWAY
// const { BroadwayPlayer } = await import('@/app/player/BroadwayPlayer');
// StreamClientScrcpy.registerPlayer(BroadwayPlayer);
/// #endif

/// #if USE_H264_CONVERTER
    const { MsePlayer } = await import('@/app/player/MsePlayer');
    StreamClientScrcpy.registerPlayer(MsePlayer);
/// #endif

/// #if USE_TINY_H264
// const { TinyH264Player } = await import('@/app/player/TinyH264Player');
// StreamClientScrcpy.registerPlayer(TinyH264Player);
/// #endif

/// #if USE_WEBCODECS
    const { WebCodecsPlayer } = await import('@/app/player/WebCodecsPlayer');
    StreamClientScrcpy.registerPlayer(WebCodecsPlayer);
/// #endif

// if (action === StreamClientScrcpy.ACTION && typeof parsedQuery.get('udid') === 'string') {
//   StreamClientScrcpy.start(parsedQuery);
//   //return;
// }
    parsedQuery.set("action","stream")
    parsedQuery.set("player","mse")
    parsedQuery.set("udid","172.20.92.38:5555")
    parsedQuery.set("hostname","ws.jtcloud.icu")
    parsedQuery.set("ws","wss://ws.jtcloud.icu:10443/?action=proxy-adb&remote=tcp:8886&udid=172.20.92.38:5555")
    parsedQuery.set("port","10443")
    parsedQuery.set("secure","true")
    StreamClientScrcpy.start(parsedQuery);


/// #endif

// const tools: Tool[] = [];
//
// /// #if INCLUDE_ADB_SHELL
// const { ShellClient } = await import('../app/googDevice/client/ShellClient');
// if (action === ShellClient.ACTION && typeof parsedQuery.get('udid') === 'string') {
//   ShellClient.start(ShellClient.parseParameters(parsedQuery));
//   return;
// }
// tools.push(ShellClient);
// /// #endif
//
// /// #if INCLUDE_DEV_TOOLS
// const { DevtoolsClient } = await import('../app/googDevice/client/DevtoolsClient');
// if (action === DevtoolsClient.ACTION) {
//   DevtoolsClient.start(DevtoolsClient.parseParameters(parsedQuery));
//   return;
// }
// tools.push(DevtoolsClient);
// /// #endif
//
// /// #if INCLUDE_FILE_LISTING
// const { FileListingClient } = await import('../app/googDevice/client/FileListingClient');
// if (action === FileListingClient.ACTION) {
//   FileListingClient.start(FileListingClient.parseParameters(parsedQuery));
//   return;
// }
// tools.push(FileListingClient);
// /// #endif
//
// if (tools.length) {
//   const { DeviceTracker } = await import('../app/googDevice/client/DeviceTracker');
//   tools.forEach((tool) => {
//     DeviceTracker.registerTool(tool);
//   });
// }
// HostTracker.start();
  }
})
</script>

<style scoped>

</style>